package com.hilon.foundation.simple;


import com.hilon.foundation.base.BaseController;
import com.hilon.foundation.util.ResultBean;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

public class BaseSimpleController<T extends EntityBaseSimple,V>
        extends BaseController<T,V> {
    protected BaseSimpleService<T,V> service;

    protected void setService(BaseSimpleService<T,V> service) {
        this.service = service;
        super.setService(service);
    }
    @PostMapping("/check")
    public ResultBean<String> check(@RequestBody T entity) {
        return service.check(entity);
    }
    @PostMapping("/checkCancel")
    public ResultBean<String> checkCancel(@RequestBody T entity) {
        return service.checkCancel(entity);
    }

    @PostMapping("/invalid")
    public ResultBean<String> invalid(@RequestBody T entity) {
        return service.invalid(entity);
    }
    @PostMapping("/canCheckCancelById/{idPara}")
    public ResultBean<String> canCheckCancelById(@PathVariable Long idPara){
        return service.canCheckCancelById(idPara);
    }
}
